home *** CD-ROM | disk | FTP | other *** search
- package com.extensibility.xml;
-
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.OutputStream;
- import java.net.HttpURLConnection;
-
- class WrapOutputStream extends OutputStream {
- private OutputStream realStream;
- private HttpURLConnection urlc;
-
- public WrapOutputStream(OutputStream var1, HttpURLConnection var2) {
- this.realStream = var1;
- this.urlc = var2;
- }
-
- public void flush() throws IOException {
- if (this.realStream != null) {
- this.realStream.flush();
- }
-
- }
-
- public void close() throws IOException {
- if (this.realStream != null) {
- this.realStream.close();
- }
-
- if (this.urlc != null) {
- InputStream var1;
- try {
- var1 = this.urlc.getInputStream();
- } catch (IOException var6) {
- this.urlc.disconnect();
- throw new IOException(((Throwable)var6).getMessage());
- }
-
- BufferedReader var3 = new BufferedReader(new InputStreamReader(var1));
-
- String var4;
- for(String var5 = ""; (var4 = var3.readLine()) != null; var5 = String.valueOf(var5).concat(String.valueOf(var4))) {
- }
-
- var3.close();
- this.urlc.disconnect();
- this.urlc = null;
- System.gc();
- }
-
- }
-
- public void write(byte[] var1) throws IOException {
- if (this.realStream != null) {
- this.realStream.write(var1);
- }
-
- }
-
- public void write(byte[] var1, int var2, int var3) throws IOException {
- if (this.realStream != null) {
- this.realStream.write(var1, var2, var3);
- }
-
- }
-
- public void write(int var1) throws IOException {
- if (this.realStream != null) {
- this.realStream.write(var1);
- }
-
- }
- }
-